<?php
namespace app\home\controller;

use app\common\controller\Frontend;
use think\Controller;
use think\Request;
use think\Db;
use fast\lucn\Lucn;

/**
 * about控制器
 * @author  Lucn30 <Lucn30@126.com>
 */

class About extends Base {

    public function _initialize(){
		parent::_initialize();
		    define('TABLE', 'page');//定义数据表名。
			define('SIGN', 'about');//定义标识
			define('PID', 7);//定义类别
			$this->assign('controller_sign',SIGN);
			$this->assign('controller_page','关于');
	}
	
    public function index(){
		return $this->Fetch(SIGN.'/_index');
    }
	
	public function show(){
		$id = input('id/d');
		/*
		$map['id'] = PID;
		$one_category = Db::name('category')
        ->where($map)
        ->find();
		unset($map);
		$map['category_id'] = PID;
		$map['status'] = 'normal';
		$clist = Db::name(TABLE)
		->where($map)
		->field('id,title')
		->select();
		
		
		unset($map);
		$map['id'] = $id;
		$one = Db::name(TABLE)
        ->where($map)
        ->find();
		//dump(Db::getLastSql());die;
		
		$scripts  = '<link href="'.config('view_replace_str.__STATIC__').'/photoswipe/photoswipe.css" rel="stylesheet">';
        $scripts .= '<link href="'.config('view_replace_str.__STATIC__').'/photoswipe/default-skin.css" rel="stylesheet">';
		$scripts .= '<script src="'.config('view_replace_str.__STATIC__').'/photoswipe/photoswipe.min.js" ></script>';
        $scripts .= '<script src="'.config('view_replace_str.__STATIC__').'/photoswipe/photoswipe-ui-default.min.js" ></script>';
		$this->assign('scripts',$scripts);
		$this->assign('one_category',$one_category);
		$this->assign('clist',$clist);
		$this->assign('about',$one);
		$type = input('type');
		$this->assign('method_sign',$type);
		*/
		$one[1]['title'] = "关于我们";
		$one[3]['title'] = "联系我们";
		$one[6]['title'] = "招商加盟";
		$one[7]['title'] = "淮王府七芯黄花菜介绍";
		$this->assign('title', $one[$id]['title'].'_'.$this->cache['site']['name']);
		$this->assign('description','淮阳县金农实业有限公司官方网站，淮王府七芯黄花菜品牌网站。');
		$this->assign('keyword','淮王府七芯黄花菜,淮阳县金农实业有限公司,淮阳黄花菜,速冻黄花菜,淮阳冷链物流');
		return $this->Fetch('/home/'.SIGN.'_show'.$id);
    }
	
	public function contact(){
        //$this->display('/about_contact');
		return $this->Fetch('/led/'.SIGN.'_contact');
    }
}